package com.alibaba.day0318yk.mapper;

import com.alibaba.day0318yk.pojo.Kc;
import com.alibaba.day0318yk.pojo.Kcmc;
import com.alibaba.day0318yk.pojo.Stu;
import com.alibaba.day0318yk.pojo.User;
import org.apache.ibatis.annotations.*;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @description:
 * @author: Wang
 * @create: 2024-03-18 09:30
 **/
@Mapper
public interface KcMapper {
    @Select("select * from user where username = #{username} and password = #{password}")
    User login(User user);

    List<Kc> list(Kc kc);

    @Select("select * from kcmc")
    List<Kcmc> selectName();

    Kc selectById(@RequestParam("id") Integer id,@RequestParam("id1") Integer id1);

    @Insert("insert into stu_kc values (null,#{id},#{id1})")
    Integer insertByid(@RequestParam("id") Integer id,@RequestParam("id1") Integer id1);

    @Delete("delete from stu_kc where kc_id = #{id} and stu_id = #{id1}")
    Integer deleteById(@RequestParam("id") Integer id,@RequestParam("id1") Integer id1);

    List<Kc> show(Integer id);


    @Select("select * from kc where kc_id = #{id}")
    List<Kc> sele(Integer id);

    List<Stu> seleMid(Integer id);
}
